layui.use(['layer', 'jquery'], function () {
    let layer = layui.layer
        , $ = layui.jquery;
    //显示学生论文分数信息
    $.ajax({
        url:"/getScore",
        type: 'post',
        data:{
            sno:sno
        },
        dataType:'json',
        success:function (data){
            setStuInfo(data);
            setGrade(data);
        }
    })

});


//设置标题信息
function setStuInfo(data) {
    $("#sNO").html(data.paper.sno);
    $("#sName").html(data.paper.sname);
    $("#major").html(data.paper.title1.majorName);
    $("#title").html(data.paper.title)
}


//设置查询到的各项成绩的信息
function setGrade(data) {
    $("#score").html(data.finalGrade);//总分
    //指导老师
    if (data.adviserGrade !== null && data.adviserGrade !== '') {
        let adsGrade1 = data.adviserGrade.grade1;
        let adsGrade2 = data.adviserGrade.grade2;
        let adsGrade3 = data.adviserGrade.grade3;
        let adsGrade4 = data.adviserGrade.grade4;
        let adsGrade5 = data.adviserGrade.grade5;
        let adsGrade6 = data.adviserGrade.grade6;
        let adsGrade = adsGrade1 + adsGrade2 + adsGrade3 + adsGrade4 + adsGrade5 + adsGrade6;
        $("#teacher-grade").html(adsGrade);
        $("#teacher-grade1").html(adsGrade1);
        $("#teacher-grade2").html(adsGrade2);
        $("#teacher-grade3").html(adsGrade3);
        $("#teacher-grade4").html(adsGrade4);
        $("#teacher-grade5").html(adsGrade5);
        $("#teacher-grade6").html(adsGrade6);
        $("#teacher-remark").html(data.adviserGrade.remark);
    }

    //评阅老师
    if (data.grading !== null && data.grading !== '') {
        let gradingGrade1 = data.grading.grade1;
        let gradingGrade2 = data.grading.grade2;
        let gradingGrade3 = data.grading.grade3;
        let gradingGrade = gradingGrade3 + gradingGrade2 + gradingGrade1;
        $("#grading-grade").html(gradingGrade);
        $("#grading-grade1").html(gradingGrade1);
        $("#grading-grade2").html(gradingGrade2);
        $("#grading-grade3").html(gradingGrade3);
        $("#grading-remark").html(data.grading.remark);
    }

    //答辩小组
    if (data.groupGrade !== null && data.groupGrade !== '') {
        let groupGrade1 = data.groupGrade.grade1;
        let groupGrade2 = data.groupGrade.grade2;
        let groupGrade3 = data.groupGrade.grade3;
        let groupGrade4 = data.groupGrade.grade4;
        let groupGrade = groupGrade1 + groupGrade2 + groupGrade3 + groupGrade4;
        $("#group-grade").html(groupGrade);
        $("#group-grade1").html(groupGrade1);
        $("#group-grade2").html(groupGrade2);
        $("#group-grade3").html(groupGrade3);
        $("#group-grade4").html(groupGrade4);
        $("#group-remark").html(data.groupGrade.remark);
    }


}



